using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace EFDataBase.Models.Mapping
{
    public class View_Order_recordMap : EntityTypeConfiguration<View_Order_record>
    {
        public View_Order_recordMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.id)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.pruduct_id)
                .HasMaxLength(50);

            this.Property(t => t.payed)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.sended)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.deletes)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.finished)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.amount)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.price)
                .IsFixedLength()
                .HasMaxLength(20);

            this.Property(t => t.product_detale)
                .HasMaxLength(550);

            this.Property(t => t.product_type)
                .HasMaxLength(50);

            this.Property(t => t.product_name)
                .HasMaxLength(50);

            this.Property(t => t.parent_id)
                .HasMaxLength(50);

            this.Property(t => t.leave_word)
                .HasMaxLength(350);

            this.Property(t => t.productset)
                .HasMaxLength(50);

            this.Property(t => t.openid)
                .HasMaxLength(50);

            this.Property(t => t.building)
                .HasMaxLength(100);

            this.Property(t => t.dorm)
                .HasMaxLength(50);

            this.Property(t => t.phone)
                .HasMaxLength(50);

            this.Property(t => t.main_img)
                .HasMaxLength(150);

            this.Property(t => t.childimg)
                .HasMaxLength(150);

            // Table & Column Mappings
            this.ToTable("View_Order_record");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.pruduct_id).HasColumnName("pruduct_id");
            this.Property(t => t.payed).HasColumnName("payed");
            this.Property(t => t.sended).HasColumnName("sended");
            this.Property(t => t.deletes).HasColumnName("deletes");
            this.Property(t => t.finished).HasColumnName("finished");
            this.Property(t => t.amount).HasColumnName("amount");
            this.Property(t => t.price).HasColumnName("price");
            this.Property(t => t.product_detale).HasColumnName("product_detale");
            this.Property(t => t.product_type).HasColumnName("product_type");
            this.Property(t => t.product_name).HasColumnName("product_name");
            this.Property(t => t.parent_id).HasColumnName("parent_id");
            this.Property(t => t.createtime).HasColumnName("createtime");
            this.Property(t => t.leave_word).HasColumnName("leave_word");
            this.Property(t => t.productset).HasColumnName("productset");
            this.Property(t => t.openid).HasColumnName("openid");
            this.Property(t => t.building).HasColumnName("building");
            this.Property(t => t.dorm).HasColumnName("dorm");
            this.Property(t => t.phone).HasColumnName("phone");
            this.Property(t => t.main_img).HasColumnName("main_img");
            this.Property(t => t.childimg).HasColumnName("childimg");
        }
    }
}
